Optimal. Leaf size=123 \[ \frac {(b c-a d) (c+d x)^{-2+n} (e+f x)^{1-n}}{d (d e-c f) (2-n)}+\frac {(a d f+b (c f (1-n)-d e (2-n))) (c+d x)^{-1+n} (e+f x)^{1-n}}{d (d e-c f)^2 (1-n) (2-n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 122, normalized size of antiderivative = 0.99, number of steps
used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {80, 37}
\begin {gather*} \frac {(b c-a d) (c+d x)^{n-2} (e+f x)^{1-n}}{d (2-n) (d e-c f)}+\frac {(c+d x)^{n-1} (e+f x)^{1-n} (a d f+b c f (1-n)-b d e (2-n))}{d (1-n) (2-n) (d e-c f)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 37
Rule 80
Rubi steps
\begin {align*} \int (a+b x) (c+d x)^{-3+n} (e+f x)^{-n} \, dx &=\frac {(b c-a d) (c+d x)^{-2+n} (e+f x)^{1-n}}{d (d e-c f) (2-n)}-\frac {(a d f+b c f (1-n)-b d e (2-n)) \int (c+d x)^{-2+n} (e+f x)^{-n} \, dx}{d (d e-c f) (2-n)}\\ &=\frac {(b c-a d) (c+d x)^{-2+n} (e+f x)^{1-n}}{d (d e-c f) (2-n)}+\frac {(a d f+b c f (1-n)-b d e (2-n)) (c+d x)^{-1+n} (e+f x)^{1-n}}{d (d e-c f)^2 (1-n) (2-n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 82, normalized size = 0.67 \begin {gather*} \frac {(c+d x)^{-2+n} (e+f x)^{1-n} (-a c f (-2+n)+a d e (-1+n)+a d f x+b d e (-2+n) x-b c (e+f (-1+n) x))}{(d e-c f)^2 (-2+n) (-1+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 161, normalized size = 1.31
method | result | size |
gosper | \(-\frac {\left (d x +c \right )^{-2+n} \left (f x +e \right ) \left (b c f n x -b d e n x +a c f n -a d e n -a d f x -b c f x +2 b d e x -2 a c f +a d e +b c e \right ) \left (f x +e \right )^{-n}}{c^{2} f^{2} n^{2}-2 c d e f \,n^{2}+d^{2} e^{2} n^{2}-3 c^{2} f^{2} n +6 c d e f n -3 d^{2} e^{2} n +2 c^{2} f^{2}-4 c d e f +2 d^{2} e^{2}}\) | \(161\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 320 vs.
\(2 (119) = 238\).
time = 2.10, size = 320, normalized size = 2.60 \begin {gather*} -\frac {{\left ({\left (b c d f^{2} n - {\left (b c d + a d^{2}\right )} f^{2}\right )} x^{3} + {\left ({\left (b c^{2} + a c d\right )} f^{2} n - {\left (b c^{2} + 3 \, a c d\right )} f^{2}\right )} x^{2} + {\left (a c^{2} f^{2} n - 2 \, a c^{2} f^{2}\right )} x - {\left (a c d n - b c^{2} - a c d + {\left (b d^{2} n - 2 \, b d^{2}\right )} x^{2} - {\left (3 \, b c d + a d^{2} - {\left (b c d + a d^{2}\right )} n\right )} x\right )} e^{2} + {\left (a c^{2} f n - 2 \, a c^{2} f - {\left (b d^{2} f n - 2 \, b d^{2} f\right )} x^{3} - {\left (a d^{2} f n - 2 \, b c d f\right )} x^{2} + {\left (b c^{2} f n - 2 \, a c d f\right )} x\right )} e\right )} {\left (d x + c\right )}^{n - 3}}{{\left (c^{2} f^{2} n^{2} - 3 \, c^{2} f^{2} n + 2 \, c^{2} f^{2} + {\left (d^{2} n^{2} - 3 \, d^{2} n + 2 \, d^{2}\right )} e^{2} - 2 \, {\left (c d f n^{2} - 3 \, c d f n + 2 \, c d f\right )} e\right )} {\left (f x + e\right )}^{n}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1058 vs.
\(2 (119) = 238\).
time = 0.51, size = 1058, normalized size = 8.60 \begin {gather*} -\frac {\frac {b c d f^{2} n x^{3} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right )\right )}}{{\left (f x + e\right )}^{n}} - \frac {b d^{2} f n x^{3} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 1\right )}}{{\left (f x + e\right )}^{n}} + \frac {b c^{2} f^{2} n x^{2} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right )\right )}}{{\left (f x + e\right )}^{n}} + \frac {a c d f^{2} n x^{2} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right )\right )}}{{\left (f x + e\right )}^{n}} - \frac {b c d f^{2} x^{3} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right )\right )}}{{\left (f x + e\right )}^{n}} - \frac {a d^{2} f^{2} x^{3} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right )\right )}}{{\left (f x + e\right )}^{n}} - \frac {a d^{2} f n x^{2} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 1\right )}}{{\left (f x + e\right )}^{n}} + \frac {2 \, b d^{2} f x^{3} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 1\right )}}{{\left (f x + e\right )}^{n}} + \frac {a c^{2} f^{2} n x e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right )\right )}}{{\left (f x + e\right )}^{n}} - \frac {b c^{2} f^{2} x^{2} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right )\right )}}{{\left (f x + e\right )}^{n}} - \frac {3 \, a c d f^{2} x^{2} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right )\right )}}{{\left (f x + e\right )}^{n}} - \frac {b d^{2} n x^{2} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 2\right )}}{{\left (f x + e\right )}^{n}} + \frac {b c^{2} f n x e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 1\right )}}{{\left (f x + e\right )}^{n}} + \frac {2 \, b c d f x^{2} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 1\right )}}{{\left (f x + e\right )}^{n}} - \frac {2 \, a c^{2} f^{2} x e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right )\right )}}{{\left (f x + e\right )}^{n}} - \frac {b c d n x e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 2\right )}}{{\left (f x + e\right )}^{n}} - \frac {a d^{2} n x e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 2\right )}}{{\left (f x + e\right )}^{n}} + \frac {2 \, b d^{2} x^{2} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 2\right )}}{{\left (f x + e\right )}^{n}} + \frac {a c^{2} f n e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 1\right )}}{{\left (f x + e\right )}^{n}} - \frac {2 \, a c d f x e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 1\right )}}{{\left (f x + e\right )}^{n}} - \frac {a c d n e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 2\right )}}{{\left (f x + e\right )}^{n}} + \frac {3 \, b c d x e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 2\right )}}{{\left (f x + e\right )}^{n}} + \frac {a d^{2} x e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 2\right )}}{{\left (f x + e\right )}^{n}} - \frac {2 \, a c^{2} f e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 1\right )}}{{\left (f x + e\right )}^{n}} + \frac {b c^{2} e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 2\right )}}{{\left (f x + e\right )}^{n}} + \frac {a c d e^{\left (n \log \left (d x + c\right ) - 3 \, \log \left (d x + c\right ) + 2\right )}}{{\left (f x + e\right )}^{n}}}{c^{2} f^{2} n^{2} - 2 \, c d f n^{2} e - 3 \, c^{2} f^{2} n + d^{2} n^{2} e^{2} + 6 \, c d f n e + 2 \, c^{2} f^{2} - 3 \, d^{2} n e^{2} - 4 \, c d f e + 2 \, d^{2} e^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.85, size = 358, normalized size = 2.91 \begin {gather*} \frac {x\,{\left (c+d\,x\right )}^{n-3}\,\left (2\,a\,c^2\,f^2-a\,d^2\,e^2-3\,b\,c\,d\,e^2-a\,c^2\,f^2\,n+a\,d^2\,e^2\,n+2\,a\,c\,d\,e\,f+b\,c\,d\,e^2\,n-b\,c^2\,e\,f\,n\right )}{{\left (e+f\,x\right )}^n\,{\left (c\,f-d\,e\right )}^2\,\left (n^2-3\,n+2\right )}+\frac {x^2\,{\left (c+d\,x\right )}^{n-3}\,\left (b\,c^2\,f^2-2\,b\,d^2\,e^2+3\,a\,c\,d\,f^2-b\,c^2\,f^2\,n+b\,d^2\,e^2\,n-2\,b\,c\,d\,e\,f-a\,c\,d\,f^2\,n+a\,d^2\,e\,f\,n\right )}{{\left (e+f\,x\right )}^n\,{\left (c\,f-d\,e\right )}^2\,\left (n^2-3\,n+2\right )}-\frac {c\,e\,{\left (c+d\,x\right )}^{n-3}\,\left (a\,d\,e-2\,a\,c\,f+b\,c\,e+a\,c\,f\,n-a\,d\,e\,n\right )}{{\left (e+f\,x\right )}^n\,{\left (c\,f-d\,e\right )}^2\,\left (n^2-3\,n+2\right )}+\frac {d\,f\,x^3\,{\left (c+d\,x\right )}^{n-3}\,\left (a\,d\,f+b\,c\,f-2\,b\,d\,e-b\,c\,f\,n+b\,d\,e\,n\right )}{{\left (e+f\,x\right )}^n\,{\left (c\,f-d\,e\right )}^2\,\left (n^2-3\,n+2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________